<template>
<div class=''>
    <button @click="increment">increment</button>
    <button @click="gotoAbout">about</button>
</div>
</template>

<script>
import { useStore } from "vuex";
import { useRouter } from "vue-router"
export default {
    setup(){
        const store = useStore()
        const count = store.state.count
        console.log("vuex >>>",count)
        const increment = ()=> {
            // mutations
            store.commit("increment")
        }

        // 使用vue-router
        const router = useRouter();
        const gotoAbout = () => {
            router.push("About")
        }
        return {
            increment,
            gotoAbout
        }
    }
}
</script>